#pragma once
#include "Pokemon.h"

#include <SDLComponent.h>
#include <string.h>
#include <TypeWriter.h>
#include <cstdlib>
#include <vector>
#include "StringUtils.h"

class Battle
	//public SDLComponent
{
public:
	Battle(Pokemon* pf,Pokemon* pb);

	void Start();
	void Update();
	void Stop();

	void UpdateHealthBar();
	void Round();
	void OnPokemonDeath(bool playersPokemon);
	void StatsText(Pokemon* pf,Pokemon* pb);
	void DynamicText(string s);
	void AttackBox(Pokemon* pb);

	void SetFrontPokemon(Pokemon* _pf){pokemon_Front = _pf;}
	void SetBackPokemon(Pokemon* _pb){pokemon_Front = _pb;}

	bool battleOver;

private:
	Pokemon* pokemon_Front;
	Pokemon* pokemon_Back;

	SDLSprite* front_HP;
	SDLSprite* back_HP;
	SDLSprite* attackBox;

	float front_Offsetx;
	float front_Offsety;
	float back_Offsetx;
	float back_Offsety;

	SDLText* attackText1;
	SDLText* attackText2;
	SDLText* attackText3;
	SDLText* attackText4;

	int x;
	int y;

	int selectionIndex;
	bool playerTurn;
	bool isPlaying;

	TypeWriter* line1;
	TypeWriter* line2;
	TypeWriter* line3; 
	string text;

	SDLSprite* cursor;
	int xRight;
	int xLeft;
	int yUp;
	int yDown;
};

